package com.zy.explore.design.patterns.singleton;

/**
 * 懒汉模式单例 并发情况下会出现多例
 *
 * @author ZY
 * @date 2021/11/03
 */
public class LanHanSingleton {

    private static LanHanSingleton instance;

    private LanHanSingleton(){

    }

    public static LanHanSingleton getInstance(){
        if (instance == null) {
            instance = new LanHanSingleton();
        }
        return instance;
    }

}
